var aSpan = document.querySelectorAll(".content_body_left span");

// 列表一
var oUl1 = document.querySelectorAll(
  ".content_body_left_li .content_body_left_list"
);
var aLi1 = document.querySelectorAll(".content_body_left_list li");
// console.log(aLi1)
var oLi1 = document.querySelectorAll(
  ".content_body_left_li .content_body_left_list li"
);

var oLi2 = document.querySelectorAll(
  ".content_body_left_li2 .content_body_left_list li"
);
// console.log(oLi2)
// 列表三
var oUl3 = document.querySelector(".content_body_left_ul3");

var aSpan = document.querySelectorAll(".content_body_left span");
var aUl = document.querySelectorAll(".content_body_left ul");
var aImg = document.querySelectorAll(".content_body_left_img2 ");

// 下拉列表
for (var i = 0; i < aLi1.length; i++) {
  aLi1[i].onclick = function () {
    for (var j = 0; j < aLi1.length; j++) {
      aLi1[j].style.backgroundColor = "";
    }
    this.style.backgroundColor = "#2561ef";
    oUl3.style.backgroundColor = "";
    flog = false;
  };
}

flog = false;
oUl3.onclick = function () {
  if (flog == false) {
    this.style.borderRadius = "5px";
    this.style.backgroundColor = "#2561ef";
    for (var i = 0; i < oLi2.length; i++) {
      oLi2[i].style.backgroundColor = "";
    }
    for (var j = 0; j < aLi1.length; j++) {
      aLi1[j].style.backgroundColor = "";
    }
    flog = true;
  } else {
    this.style.backgroundColor = "";
    flog = false;
  }
};
// 循环span节点
for (var i = 0; i < aSpan.length; i++) {
  // 设置span的点击事件
  aSpan[i].onclick = function () {
    var oUl = this.nextElementSibling.nextElementSibling;
    if (getComputedStyle(oUl).height == "0px") {
      this.nextElementSibling.style.transform = "rotate(180deg)";
      oUl.style.height =
        oUl.children[0].offsetHeight * oUl.children.length + "px";
    } else {
      // 否则高度为0
      oUl.style.height = "0" + "px";
      this.nextElementSibling.style.transform = " rotate(90deg)";
    }
  };
}
